A modern security system often comprises a number of surveillance cameras. The surveillance cameras give the security personnel a possibility to monitor a large area, such as several floors in an office building. They also give security personnel a good instrument for verifying that an alarm is a true alarm before taking any further actions.
Some security systems are arranged to record a video sequence from a time period starting before a detection, e.g. an alarm, and ending at the time of the detection. This type of video sequence is referred to as a pre-alarm video sequence. Of course, such security systems may record a video sequence starting at the time of the detection and ending at an arbitrary time as well. This type of video sequence is referred to as a post-alarm video sequence. The recorded pre-alarm video sequences may facilitate verification of whether the detection is due to a true alarm event or not and may provide video on the event preceding the detection.
Since video sequences generally are compressed according to some compression standard, e.g. MPEG-4, characteristics of the specific compression scheme have to be considered.
For example, a common basic principle of video compression is to replace some full image frames by differential image frames, wherein a differential image frame contains the difference between the preceding full image frame and the replaced full image frame and a full image frame contains complete image data. In this way all information describing each full image frame does not have to be stored or sent, but only the differences between the present frame and a previous frame have to be stored or sent which in turn means that less data has to be stored or sent.
Accordingly, when decompressing the compressed video stream a differential image frame is combined with the present image and is thus recreating the image represented by the differential image.
Generally, such a compressed video sequence or such a compressed video stream is provided with a number of full image frames and in-between the full image frames is a number of differential image frames arranged. The number of differential image frames between two adjacent full image frames depends on the desired compression rate and/or quality.
For example, a first frame is a full image frame, a second, a third and a fourth frame are differential image frames, a fifth frame is a full image frame, a sixth, a seventh and an eighth frame are differential image frames, and so on. The first frame contains information of a complete image, and does not need to be combined with image information from another frame in order to represent a complete image. However, in order to achieve the next complete image the first frame, containing full image data, and the second differential image frame, containing the differences between the first image and the second image, are combined into a second image frame representing the second complete image. In order to achieve a third full image frame the second complete image and the third differential image frame are combined into a third complete image, and so on until the fifth frame, which is a full image frame, whereas the procedure is repeated.
In some compression schemes based on the common principle described above, different types of differential image frames are used, such as P-frames and B-frames in the MPEG standards which are standards well known to the person skilled in the art.
Hence, when retrieving a pre-alarm video sequence from a pre-alarm buffer, e.g. from a first-in-first-out (FIFO) buffer, the video sequence in the buffer may begin with a number of differential image frames, which means that the initial frames of a video sequence do not contain enough information for presenting complete images.
One alternative is to present all of the frames in the pre-alarm buffer to the operator, including the first differential frames. Since the full image frame that these differential images are based on is not present, the first frames of the pre-alarm video sequence will not present correct image information.
Another solution is to introduce an electric device, which locates the first full image frame of the pre-alarm video sequence. In this way, the memory usage is more efficient and no frame containing correct image information is lost.
One drawback with this is that the length of the pre-alarm video sequence will vary from time to time, e.g. if a pre-alarm sequence of 10 seconds is selected and the video sequence includes reasonably many differential frames, then there may be 4 seconds of non usable differential video frames at the beginning of the pre-alarm video sequence.
One solution to solve this problem may be to expand the buffer. In this way a number of extra frames may be stored, i.e. the start of the pre-alarm video sequence is transferred back in time. Then, it is possible to select the number of extra frames so that all the image frames representing the selected pre-alarm time period may be decompressed.
This solution has some drawbacks. Firstly, the length of the pre-alarm video sequence will vary from time to time. Secondly, the number of added extra frames required is dependent on the compression rate, since a higher compression rate often means more differential image frames and less full image frames. Hence, the number of added extra frames must be high in order to support a video sequence having high compression rate.